package com.boang.nio;

import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
/*
    @author:sa
    @date:2024/12/13 10:11
*/
public class FilePaths {
    public static void main(String[] args) throws IOException {
        Path path = Paths.get("C:\\Users\\sa\\Desktop\\a");
        Files.createDirectory(path);
//        Path file = Paths.get("C:\\Users\\sa\\Desktop\\a\\a.text");
//        Files.createFile(file);
        Path file = Paths.get("C:\\Users\\sa\\Desktop\\a\\a.text");
        BufferedWriter bufferedWriter = Files.newBufferedWriter(file);
        bufferedWriter.write("abc");
        bufferedWriter.close();
        Path b = Paths.get("C:\\Users\\sa\\Desktop\\a\\b.text");
        Files.copy(file,b);
    }
}